import http from '@/utils/request'

class RoleServiceTemp {
	useRoleMenuApi() {
		return http.get('/sys/role/menu')
	}

	useRoleApi(id: number) {
		return http.get('/sys/role/' + id)
	}

	useRoleListApi() {
		return http.get('/sys/role/list')
	}

	useRoleSubmitApi(dataForm: any) {
		if (dataForm.id) {
			return http.put('/sys/role', dataForm)
		} else {
			return http.post('/sys/role', dataForm)
		}
	}
}

const RoleService = new RoleServiceTemp()
export {
	RoleService
}
